﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Nuanyang.Asp.Net.Core.Extension.Entities;

namespace Nuanyang.Asp.Net.Core.Extension.Repository.Group
{
    public class GroupFunctionEntityConfiguration : IEntityTypeConfiguration<GroupFunctionEntity>
    {
        /// <summary>
        /// GroupFunction表结构
        /// </summary>
        /// <param name="builder"></param>
        public void Configure(EntityTypeBuilder<GroupFunctionEntity> builder)
        {
            builder.ToTable("GroupFunction");

            builder.HasKey(x => x.Id);

            builder.Property(x => x.Id).IsRequired().ValueGeneratedOnAdd();

            builder.Property(x => x.GroupId).IsRequired();

            builder.Property(x => x.FunctionId).IsRequired();

            builder.Property(x => x.IsEnable).IsRequired();

            builder.Property(x => x.CreateTime).IsRequired();

            builder.Property(x => x.UpdateTime).IsRequired();

            builder.Property(x => x.IsDeleted).IsRequired();
        }
    }
}
